package com.fone.player.storage;

import java.util.ArrayList;
import java.util.List;

import com.fone.player.entity.OfflineCache;

/**
 * 
 * 收藏模块
 * 
 * @author wangyang
 * @since 2014年4月29日
 */
class FavouriteModule {
	private static final FavouriteModule mInstance = new FavouriteModule();

	private FavouriteModule() {
	}

	static FavouriteModule getInstance() {
		return mInstance;
	}

	/**
	 * 
	 * 获得收藏第一级目录集合
	 * 
	 * @return ArrayList<OfflineCache> 收藏集合
	 */
	public ArrayList<OfflineCache> getFavouriteList() {
		return FavouriteDataBaseAdapter.getInstance().getFavouriteList(
				OfflineCache.CACHE_FAVOURITE_SYNCHRONZIE_CLIENT_ALL);
	}

	/**
	 * 
	 * 合并收藏下载状态
	 * 
	 * @param offlineCacheList
	 *            待合并集合
	 * @return List<OfflineCache>
	 */
	public List<OfflineCache> mergeFavouriteDownloadStateByVideoId(
			List<OfflineCache> offlineCacheList) {
		for (OfflineCache offlineCache : offlineCacheList) {
			OfflineCacheFileDataBaseAdapter.getInstance()
					.getOfflineCacheByVideoId(offlineCache);
		}
		return offlineCacheList;
	}
}
